home *** CD-ROM | disk | FTP | other *** search
- #ifndef MODULE_R_H
- #define MODULE_R_H
-
- /* This file defines the types and contents of various resources found
- * in a plugin-module file. It is designed to be included from both Rez
- * and C/C++ source files.
- */
-
-
- // Resource type for module definition resources.
- #define ModuleDefType 'MDdf'
-
- // Resource type for module code resources.
- #define ModuleCodeType 'MDcd'
-
- // Resource type for inter-module dependency info.
- #define ModuleDepType 'MDdp'
-
- // Types for an entry in a dependency list.
- #define dEqual 1 // Precise module version must be present
- #define dGreaterOrEqual 2 // Module of greater or equal version must be present
- #define dLessOrEqual 3 // Module of smaller or equal version must be present
-
-
- #ifndef REZ
- // This enum defines the bits in the flags field of a ModuleDef record.
- enum ModuleFlags
- {
- mfLoadAtBoot = 1, // Set if the module should be loaded (and its root
- // function called) when the module file is opened,
- // typically at application boot time. NOTE: this
- // flag is not currently supported; Arrange 2.0 will
- // always load the module at boot time, even if the
- // flag is not set.
- mfKeepLocked = 2 // Set if the module's code resources should be kept
- // locked in memory whenever the module is open. This
- // should be set for modules which are called often (e.g.
- // any module with an AboutToMenu or Tick hook).
- }; // ModuleFlags
-
-
- // This struct defines the structure of a module definition resource ('MDdf').
- struct ModuleDef
- {
- unsigned char vers; // Record version number (currently 1).
- unsigned char modFormatVers;// Module format version number (currently 2).
- unsigned short flags; // ModuleFlags values (set unused bits to zero).
- char name[32]; // Unique name (0-terminated) for this module.
- unsigned long id; // Unique ID (registered with CKI) for this module.
- unsigned long modVers; // Module version.
- unsigned long modDate; // Compile/link date for this version.
- unsigned long targetApp; // Application to which this module is targeted; 0
- // if module can load in any application.
- unsigned long minSysVers; // Minimum system version (from Gestalt) to load module.
- unsigned long minAppVers; // Minimum application version to load module.
- short rootCodeID; // ID of the root code resource ('MDcd') for this
- // module (code resource containing the module's boot
- // function); value is relative to the ID of the 'MDdf'
- // resource. -1 if module has no boot function.
- }; // ModuleDef
-
-
- // This struct defines an entry in an inter-module dependency list.
- struct ModuleDepEntry
- {
- unsigned long type; // Dependency type (see constants above).
- unsigned long targetID; // 'id' field of target module's ModuleDef.
- unsigned long targetVers; // 'vers' field of target module's ModuleDef.
- }; // ModuleDepEntry
-
-
- // This struct defines the structure of a module dependency-info resource ('MDdp').
- struct ModuleDepInfo
- {
- unsigned char vers; // Record version number (currently 1).
- unsigned char pad; // Unused (set to zero).
- short count; // Number of dependency entries.
- ModuleDepEntry entries[1]; // Array of dependency records.
- }; // ModuleDepInfo
-
-
- #else // else REZ is defined
-
- type ModuleDefType
- {
- byte = 1; // vers
- byte = 2; // modFormatVers
- bitstring[14] = 0; // unused bits in flags word
- boolean dontKeepLocked,keepLocked;
- boolean dontLoadAtBoot,loadAtBoot;
- pstring[31]; // name
- unsigned longint; // id
- unsigned longint; // modVers
- unsigned longint; // modDate
- unsigned longint; // targetApp
- unsigned longint; // minSysVers
- unsigned longint; // minAppVers
- integer; // rootCodeID
- };
-
-
- type ModuleDepType
- {
- byte = 1; // vers
- byte = 0; // pad
- integer = $$Countof(DepArray); // count
- wide array DepArray
- {
- unsigned longint; // type
- unsigned longint; // targetID
- unsigned longint; // targetVers
- };
- };
-
-
- #endif // else REZ is defined
-
- #endif // ifndef MODULE_R_H
-